<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>高校宿舍管理系统-我的宿舍-卫生检查情况</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="#"/>
    <link rel="stylesheet" href="../layui/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../layui/css/public.css" media="all">
    <link rel="stylesheet" href="../layui/lib/font-awesome-4.7.0/css/font-awesome.css">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
    </div>
</div>
<script src="../layui/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>

    layui.use(['form', 'table', 'layer'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table,
            layer = layui.layer;

        var tableIns = table.render({
            elem: '#currentTableId',
            url: '/student/clean/list',
            cols: [
                [
                    {field: 'brarea', width: 140, title: '宿舍区', align: "center"},
                    {field: 'brbid', width: 100, title: '楼栋', align: "center"},
                    {field: 'brrid', width: 100, title: '寝室', align: "center"},
                    {field: 'content', minWidth: 400, title: '检查内容'},
                    {field: 'grade', width: 80, title: '分数', align: "center"},
                    {field: 'time', width: 150, title: '检查时间', align: "center"}
                ]
            ],
            limits: [5, 10, 20, 25, 50, 100],
            limit: 10,
            page: true,
            skin: 'line',
            even: true,
            done: function (res, curr, count) {
                var that = this.elem.next();
                res.data.forEach(function (item, index) {
                    if (item.grade < 60) {
                        var td = that.find(".layui-table-box tbody tr[data-index='" + index + "'] td[data-field='grade']");
                        td.css("background-color", "#ef4136");
                        td.css("color", "white");
                    }
                });
            }
        });
    });
</script>

</body>
</html>